home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / appkit.777 < prev    next >
Text File  |  1992-02-06  |  1KB  |  46 lines

  1. {\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f1\fmodern Courier;}
  2. \paperw11220
  3. \paperh7960
  4. \margl120
  5. \margr1000
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b0\i0\ul0\fs28 NXWriteTypes memory exception error\
  8. \
  9. Q:  I am using 
  10. \b NXWriteTypes()
  11. \b0  to  archive a character array as follows:\
  12. \
  13.  
  14. \pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220\f1\fs24     NXWriteTypes (typedStream, "[32c]", &myCharArray);\
  15. \
  16.  
  17. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\fs28 I am following the syntax specified in the documentation, but I consistently get a memory exception error.  Why?\
  18. \
  19. A: The reason is that you are using 
  20. \b NXWriteTypes()
  21. \b0  (plural), which expects multiple types of data, but you only have one single data type.  The fix is to use 
  22. \b NXWriteType()
  23. \b0 :\
  24. \
  25.  
  26. \f1\fs24     NXWriteType(typedStream, "[32c]", &myCharArray)
  27. \f2\fs28 ;\
  28. \
  29. There is another way to archive an array with the specialized NXFunction 
  30. \b NXWriteArray()
  31. \b0 .  The above example would be changed to:\
  32. \
  33.  
  34. \f1\fs24     NXWriteArray(stream, "c",  32, myCharArray);\
  35.  
  36. \f2\fs28 \
  37. Note the different syntax, and see the technical documentation for details on other types of array elements.\
  38. \
  39.  
  40. \fc0 QA777\
  41. \
  42. Valid for 1.0\
  43. Valid for 2.0\
  44. \
  45.  
  46.